package com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family;

import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.dto.BusinessEmployeeFamilyListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.param.BusinessEmployeeFamilyCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.param.BusinessEmployeeFamilyDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.param.BusinessEmployeeFamilyListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.param.BusinessEmployeeFamilyUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 员工家庭信息
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Employee Family Management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessEmployeeFamilyCloudServiceFallback.class)
@RequestMapping("/business/employee/family")
public interface BusinessEmployeeFamilyCloudService {

    // 查询员工家庭信息列表
    @ApiOperation(value = "Query Employee Family List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.BusinessEmployeeFamilyCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessEmployeeFamilyListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Employee Family List", dataType = "BusinessEmployeeFamilyListCloudParam", dataTypeClass = BusinessEmployeeFamilyListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessEmployeeFamilyListCloudDto list(BusinessEmployeeFamilyListCloudParam param);

    // 创建员工家庭信息
    @ApiOperation(value = "Create Employee Family", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.BusinessEmployeeFamilyCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Employee Family", dataType = "BusinessEmployeeFamilyCreateCloudParam", dataTypeClass = BusinessEmployeeFamilyCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessEmployeeFamilyCreateCloudParam param);


    // 编辑员工家庭信息
    @ApiOperation(value = "Update Employee Family", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.BusinessEmployeeFamilyCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Employee Family", dataType = "BusinessEmployeeFamilyUpdateCloudParam", dataTypeClass = BusinessEmployeeFamilyUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody BusinessEmployeeFamilyUpdateCloudParam param);


    // 删除员工家庭信息
    @ApiOperation(value = "Delete Employee Family", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.hr.employee.family.BusinessEmployeeFamilyCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Employee Family", dataType = "BusinessEmployeeFamilyDeleteCloudParam", dataTypeClass = BusinessEmployeeFamilyDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessEmployeeFamilyDeleteCloudParam param);

}
